home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
loancalc.arc
/
INTRAISE.PAS
next >
Wrap
Pascal/Delphi Source File
|
1991-04-28
|
395b
|
16 lines
{.PA}
{.PL64}
FUNCTION IntRaise(base: real; expt: integer): real;
{ Raises a real number to an integer exponent }
BEGIN
IF expt = 0 THEN
IntRaise := 1
ELSE IF expt < 0 THEN
IntRaise := 1 / IntRaise(base, -expt)
ELSE
IF odd(expt) THEN
IntRaise := IntRaise(base, expt - 1) * base
ELSE
IntRaise := sqr(IntRaise(base, expt div 2))
END; { IntRaise }